package com.bua.datafactory;

import android.util.Base64;
import com.bua.net.Tool;
import org.json.JSONException;

/**
 * Created with IntelliJ IDEA.
 * User: ningning
 * Date: 13-7-10
 * Time: 下午10:41
 * To change this template use File | Settings | File Templates.
 */
public class DesignDetailDataFactory extends DataFactory {
    public String designId;
    public byte[] designImage;
    public String jigongsuo;
    public String createdDate;

    public DesignDetailDataFactory(String jsonString) {
        super(jsonString);

        if (status == 200) {
            try {
                designId = body.getString("designId");
                jigongsuo = body.getString("jigongsuo");
                createdDate = body.getString("createdDate");
                designImage = Base64.decode(body.getString("designImage"), Base64.DEFAULT);

            } catch (JSONException e) {

            }
        }
    }

    public Object GetItem(String key) {
        try {
            return body.get(key);
        } catch (JSONException e) {
            e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
            return null;
        }
    }

}
